// 业务封装：带完整交互效果的按钮组件
import * as React from 'react'
import { Button, ButtonProps } from '../ui/button'
import { cn } from '@shared/shared-utils'

interface EnhancedButtonProps extends ButtonProps {
  // 可以在这里添加业务相关的 props
}

const EnhancedButton = React.forwardRef<HTMLButtonElement, EnhancedButtonProps>(
  ({ className, ...props }, ref) => {
    return (
      <Button
        className={cn(
          // 添加点击效果和更好的过渡动画
          'transition-all duration-150',
          'active:scale-95',
          // 根据变体添加不同的点击效果
          props.variant === 'default' && 'active:bg-primary/80',
          props.variant === 'destructive' && 'active:bg-destructive/80',
          props.variant === 'outline' && 'active:bg-accent/80',
          props.variant === 'secondary' && 'active:bg-secondary/70',
          props.variant === 'ghost' && 'active:bg-accent/80',
          props.variant === 'link' && 'active:text-primary/80',
          className,
        )}
        ref={ref}
        {...props}
      />
    )
  },
)
EnhancedButton.displayName = 'EnhancedButton'

export { EnhancedButton }
